package com.ruoyi.doorcontrol.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.doorcontrol.mapper.ThOpengateRecordsMapper;
import com.ruoyi.doorcontrol.domain.ThOpengateRecords;
import com.ruoyi.doorcontrol.service.IThOpengateRecordsService;

/**
 * 车辆进入记录Service业务层处理
 * 
 * @author zhang
 * @date 2024-07-20
 */
@Service
public class ThOpengateRecordsServiceImpl implements IThOpengateRecordsService 
{
    @Autowired
    private ThOpengateRecordsMapper thOpengateRecordsMapper;

    /**
     * 查询车辆进入记录
     * 
     * @param id 车辆进入记录主键
     * @return 车辆进入记录
     */
    @Override
    public ThOpengateRecords selectThOpengateRecordsById(Long id)
    {
        return thOpengateRecordsMapper.selectThOpengateRecordsById(id);
    }

    /**
     * 查询车辆进入记录列表
     * 
     * @param thOpengateRecords 车辆进入记录
     * @return 车辆进入记录
     */
    @Override
    public List<ThOpengateRecords> selectThOpengateRecordsList(ThOpengateRecords thOpengateRecords)
    {
        return thOpengateRecordsMapper.selectThOpengateRecordsList(thOpengateRecords);
    }

    /**
     * 新增车辆进入记录
     * 
     * @param thOpengateRecords 车辆进入记录
     * @return 结果
     */
    @Override
    public int insertThOpengateRecords(ThOpengateRecords thOpengateRecords)
    {
        thOpengateRecords.setCreateTime(DateUtils.getNowDate());
        return thOpengateRecordsMapper.insertThOpengateRecords(thOpengateRecords);
    }

    /**
     * 修改车辆进入记录
     * 
     * @param thOpengateRecords 车辆进入记录
     * @return 结果
     */
    @Override
    public int updateThOpengateRecords(ThOpengateRecords thOpengateRecords)
    {
        return thOpengateRecordsMapper.updateThOpengateRecords(thOpengateRecords);
    }

    /**
     * 批量删除车辆进入记录
     * 
     * @param ids 需要删除的车辆进入记录主键
     * @return 结果
     */
    @Override
    public int deleteThOpengateRecordsByIds(Long[] ids)
    {
        return thOpengateRecordsMapper.deleteThOpengateRecordsByIds(ids);
    }

    /**
     * 删除车辆进入记录信息
     * 
     * @param id 车辆进入记录主键
     * @return 结果
     */
    @Override
    public int deleteThOpengateRecordsById(Long id)
    {
        return thOpengateRecordsMapper.deleteThOpengateRecordsById(id);
    }
}
